package com.example.baseapp.controller;

import com.example.baseapp.common.ApiResponse;
import com.example.baseapp.entity.Category;
import com.example.baseapp.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/category")
public class CategoryController {
    
    @Autowired
    private CategoryService categoryService;
    
    // 获取所有分类
    @PostMapping("/list")
    public ApiResponse<List<Category>> getAllCategories(@RequestBody(required = false) Map<String, Object> params) {
        return ApiResponse.success(categoryService.getAllCategories());
    }
} 